<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>日程安排</title>
<link href="/widget/bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet"  type="text/css"/>
<link href="/widget/iconfont/iconfont.css" rel="stylesheet" />
<link href="/res/css/inside_page.css" rel="stylesheet"  type="text/css"/>
{cssjs}
<script language="javascript" type="text/javascript" src="/widget/datepicker/WdatePicker.js"></script>
<link href='/widget/fullcalendar/fullcalendar.min.css' rel='stylesheet' />
<link href='/widget/fullcalendar/fullcalendar.print.min.css' rel='stylesheet' media='print' />
<script src='/widget/fullcalendar/lib/moment.min.js'></script>
<script src='/widget/fullcalendar/lib/jquery.min.js'></script>
<script src='/widget/fullcalendar/fullcalendar.min.js'></script>
<script src='/widget/fullcalendar/locale/zh-cn.js'></script>
</head>

<body>
<div class="container-fluid larry-wrapper">
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12">
            <section class="panel panel-padding">
                <button class="layui-btn layui-btn-small layui-btn-warm ajax-all" id="btn_ref">
                    <i class="iconfont">&#xe62e;</i> 刷新
                </button>
                <div id="calendar"></div>
            </section>
         </div>
     </div>
</div>
   {jsmodel}
   <script type="text/javascript">
        layui.use('schedule_sys');      
        $(document).ready(function(){
            var uid = '{uid}';
            $('#calendar').fullCalendar({
               //theme: true,
                header: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'month,agendaWeek,agendaDay'
                },   
                timeFormat:'H:mm', //默认是{agenda: h:mm{ - h:mm}}   
                monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
                monthNamesShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
                dayNames: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
                dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
                today: ["今天"],
                firstDay: 1,
                buttonText: {
                    today: '本月',
                    month: '月',
                    week: '周',
                    day: '日',
                    prev: '上一月',
                    next: '下一月'
                },
                height:$(window).height() - 140,
                selectable: true,  
                selectHelper: true,   
                editable: true,  
                allDayDefault:false,  
                events:{  //获取日程数据
                    url: '/srv/rdo.php',  
                    type: 'post',
                    data:{
                        tpl:'get_schedule_byuid',
                        uid:uid
                    }  
                }, 
                dayClick: function(start, end, jsEvent, view){ //点击某一天 
                    var s = $.fullCalendar.formatDate(start,"YYYY-MM-DD HH:mm:ss");   
                    layer.open({
                      type: 2,
                      title: '新建事务',
                      shadeClose: true,
                      shade: 0.8,
                      area: ['600px','560px'],
                      content: '?t=schedule_edit&start='+s,
                      end:function(){
                        location.reload();
                      }
                    }); 
                },  
                eventClick:function(calEvent, jsEvent, view){  //点击某一个日程
                    layer.alert(calEvent.start_time+'   -   '+calEvent.end_time+'<br/>'+calEvent.content);
                    // layer.open({
                    //   type: 2,
                    //   title: '编辑事务',
                    //   shadeClose: true,
                    //   shade: 0.8,
                    //   area: ['600px','560px'],
                    //   content: '?t=edit_schedule&id='+calEvent.id,
                    //   end:function(){
                    //     location.reload();
                    //   }
                    // }); 
                }
            });
        
        });
		
    </script>
</body>
</html>
